1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*!
`isotope` instants
*/

use super::*;

/// The instant at infinity
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub struct Infty;

impl Value for Infty {
    #[inline]
    fn ty(&self) -> &ValId {
        &*FREE_LIFETIME
    }
    #[inline]
    fn is_instant(&self) -> bool {
        true
    }
    #[inline]
    fn into_enum(self) -> ValueEnum {
        ValueEnum::Infty(Infty)
    }
    #[inline]
    fn into_valid(self) -> ValId {
        INFTY.clone()
    }
    #[inline]
    fn code(&self) -> u64 {
        0x494e465459
    }
}

/// The instant at zero, i.e. initialization
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub struct Zero;

impl Value for Zero {
    #[inline]
    fn ty(&self) -> &ValId {
        &*FREE_LIFETIME
    }
    #[inline]
    fn is_instant(&self) -> bool {
        true
    }
    #[inline]
    fn into_enum(self) -> ValueEnum {
        ValueEnum::Zero(Zero)
    }
    #[inline]
    fn into_valid(self) -> ValId {
        ZERO.clone()
    }
    #[inline]
    fn code(&self) -> u64 {
        0x5a45524f
    }
}

lazy_static! {
    /// The instant at infinity
    pub static ref INFTY: ValId = ValId::new_direct(ValueEnum::Infty(Infty));
    /// The instant at zero
    pub static ref ZERO: ValId = ValId::new_direct(ValueEnum::Zero(Zero));
}